Program Generators and the Tools to Make Them
نویسندگان
چکیده
Program generation is among the most promising techniques in the effort to increase the automation of programming tasks. In this paper we discuss the potential impact and research value of program generation, give examples of our research in the area, and outline a future work direction that we consider most interesting. Specifically, we first discuss why program generators have significant applied potential. At the same time we argue that as a research topic, metaprogramming tools (i.e., language tools for writing program generators) may be of greater value. We illustrate our views on generators and meta-programming tools with our latest work on the Meta-AspectJ meta-programming language and the GOTECH generator. Finally, we examine the problem of statically determining the safety of a generator and present its intricacies. We limit our focus to one particular kind of guarantee for generated code—ensuring that the generated program is free of compile-time errors. We believe that this research direction will see significant attention and will make a big difference in the mainstream adoption of meta-programming technology. 1. PROGRAM GENERATORS AND METAPROGRAMMING We first present some general thoughts on program generators. We concentrate on frequently-asked questions about the nature and value of generators, as well as the research promise of the area. 1.1 What Are Program Generators? A program generator (or just generator) is a program that generates other programs. This broad definition is often qualified to include constraints such as “the generated program is expressed in a high-level programming language”. No definition, however, offers strict boundaries distinguishing generators from traditional compilers, text-generating programs, etc. Thus, what really constitutes a generator is often determined intuitively and does not reflect so much a Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. PEPM’04, August 24–26, 2004, Verona, Italy. Copyright 2004 ACM 1-58113-835-0/04/0008 ...$5.00. technical distinction as the emphasis in the development of the “generator”. A related concept is meta-programming. Meta-programming can be described as the creation of a program that computes (something about) other programs. Meta-programming tools constitute the general platform for implementing generators in a given language setting. To understand what generators are we should look at their common uses. In practice, generators are typically compilers for domain-specific languages (DSLs). A domain-specific language is a special-purpose programming language for a particular software domain. A “domain” can be defined either by its technical structure (e.g., the domain of reactive real-time programs, the domain of LALR language parsers) or by real-world application (e.g., the database domain, the telephony domain, etc.). The purpose of restricting attention to specific domains is to exploit the domain features and knowledge to increase automation. If we view generators as compilers for DSLs, it is worth asking how they differ from general-purpose language compilers. Indeed, the research and practice of program generators is very different from that of general-purpose compilers. A general-purpose language compiler implements a stable, separately defined specification and can take several man-years to develop. In contrast, a generator is typically co-designed with the DSL that it implements. Thus, the emphasis is not on deeply analyzing a program to infer its properties, but on designing the DSL so that the properties are clearly exposed and on having the generator exploit them with as little effort as possible. The effort of implementing a program generator is typically small—comparable to the effort of implementing a software library for the domain. This is largely the result of leveraging the high-level language (commonly called the object language) in which the generated programs are expressed. The above features of program generators (domainspecificity, language/generator co-design, low-effort development) also define the focus of research in the area. Most research in program generators concentrates either on specific domains that are amenable to a generator-based approach or on meta-programming tools that simplify generator implementation. 1.2 Why Care about Generators? Program generators have been an active research focus since the early days of Computer Science. The main reasons that researchers are attracted to program generators have to do with the inherently interesting conceptual problems of meta-programming and with the potential for practical benefit. For many researchers, meta-programming is an intellectually fascinating topic. After all, computer scientists are people who find computations interesting. What then can be more interesting than computing about computations? The canonical sensationalist example is self-generating programs. It is easy to be intrigued by programs whose task is to output their own program text. For example, we can have: ((lambda (x) (list x (list ’quote x))) ’(lambda (x) (list x (list ’quote x))))
منابع مشابه
Design Optimization for Total Volume Reduction of Permanent Magnet Synchronous Generators
Permanent magnet synchronous generators (PMSGs) are novel generators which can be used in high-performance wind farms. High efficiency and flexibility in producing electricity from variable rotation make them good candidate for wind power applications. Furthermore, because these kinds of generators have no excitation winding, there is no copper loss on rotor; hence, they can operate at high pow...
متن کاملOptimal Energy Procurement of Smart Large Consumers Incorporating Parking Lot, Renewable Energy Sources and Demand Response Program
Large commercial and industrial loads known as large energy consumers are always seeking to reduce their energy costs and consequently they are utilizing renewable and non-renewable energy sources in procurement of their required energy. Use of renewable energy sources (RESs) and plug-in electric vehicles (PHEVs) parking lot without proper planning will make technical and economic problems for ...
متن کاملModelling the Level of Adoption of Analytical Tools; An Implementation of Multi-Criteria Evidential Reasoning
In the future, competitive advantages will be given to organisations that can extract valuable information from massive data and make better decisions. In most cases, this data comes from multiple sources. Therefore, the challenge is to aggregate them into a common framework in order to make them meaningful and useful.This paper will first review the most important multi-criteria decision analy...
متن کاملEvaluation of medical education virtual program: P3 model
Introduction: In e-learning, people get involved in a processand create the content (product) and make it available for virtuallearners. The present study was carried out in order to evaluatethe first virtual master program in medical education at ShirazUniversity of Medical Sciences according to P3 Model.Methods: This is an evaluation research study with post singlegroup design used to determi...
متن کاملMedical Students’ Perception of Using Electronic Learning Tools in an ESP Program
Given the burgeoning interest in the use of technology and electronic tools for educational purposes among students, this study set out with the purpose of investigating medical students’ perception of using e-learning tools and applications in an English for Specific Purposes (ESP) program at an Iranian medical university. The study also aimed to discover the extent to which the students...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2004